using System;
using System.Data;
using Utils;
using Utils.DatabaseUtils;


namespace QLCG.DAO
{
public class tblQuaTrinhCongTacUI
{ 
	private int idCongTac;
	public int IdCongTac
	{
		get { return idCongTac;}
		set { idCongTac = value;}
	}

	private int idChuyenGia;
	public int IdChuyenGia
	{
		get { return idChuyenGia;}
		set { idChuyenGia = value;}
	}

	private String tenCoQuan;
	public String TenCoQuan
	{
		get { return tenCoQuan;}
		set { tenCoQuan = value;}
	}

	private DateTime tuThoiGian;
	public DateTime TuThoiGian
	{
		get { return tuThoiGian;}
		set { tuThoiGian = value;}
	}

	private DateTime denThoiGian;
	public DateTime DenThoiGian
	{
		get { return denThoiGian;}
		set { denThoiGian = value;}
	}

	private String moTaCongViec;
	public String MoTaCongViec
	{
		get { return moTaCongViec;}
		set { moTaCongViec = value;}
	}

	public tblQuaTrinhCongTacUI() {}

	public tblQuaTrinhCongTacUI(int idCongTac, int idChuyenGia, String tenCoQuan, DateTime tuThoiGian, DateTime denThoiGian, String moTaCongViec)
	 {
		this.idCongTac = idCongTac;
 		this.idChuyenGia = idChuyenGia;
 		this.tenCoQuan = tenCoQuan;
 		this.tuThoiGian = tuThoiGian;
 		this.denThoiGian = denThoiGian;
 		this.moTaCongViec = moTaCongViec;
 	}

	public int Add(int idChuyenGia, String tenCoQuan, DateTime tuThoiGian, DateTime denThoiGian, String moTaCongViec, string viTri)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblQuaTrinhCongTac_Add",idChuyenGia,tenCoQuan,tuThoiGian,denThoiGian,moTaCongViec, viTri);
			return result;
		}
		catch(Exception e) {return -1; }
	}

    public int Update(int idCongTac, int idChuyenGia, String tenCoQuan, DateTime tuThoiGian, DateTime denThoiGian, String moTaCongViec, string viTri)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblQuaTrinhCongTac_Update",idCongTac,idChuyenGia,tenCoQuan,tuThoiGian,denThoiGian,moTaCongViec, viTri);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int idCongTac)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblQuaTrinhCongTac_Delete",idCongTac);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblQuaTrinhCongTac_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int idCongTac)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblQuaTrinhCongTac_Get",idCongTac);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblQuaTrinhCongTac_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdChuyenGia(int idChuyenGia)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblQuaTrinhCongTac_GetByIdChuyenGia",idChuyenGia);
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
